$color-bg-start: #7C6C91;
$color-bg-header-end: #807695;
$color-bg-footer-start: #b0bcc0;
$color-bg-end: #B2C4C6;

$height-header: 60px;
$height-footer: 90px;

$padding-top-header: 8px;

// 手机&平板设备样式
@media screen and (max-width: 959px) {
  .van-root {
    background: transparent !important;
  }

  .chat-wrap {
    min-height: 100%;
    //background-image: linear-gradient(180deg, $color-bg-start 0%, $color-bg-end 100%);
    //background: linear-gradient(180deg, $color-bg-start 0%, $color-bg-end 100%);

    .chat-header {
      z-index: 10;
      height: $height-header;
      position: fixed;
      top: 0;
      width: 100vw;
      background: $color-bg-start;
      background: linear-gradient(180deg, $color-bg-start 0%, $color-bg-header-end 100%);

      color: #FFFFFF;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      h1 {
        font-weight: 400;
        font-size: 18px;
        line-height: 26px;
      }

      .tip-pc {
        display: none;
      }
      .tip {
        margin-top: 2px;
        font-size: 12px;
        display: flex;
        justify-content: center;
        align-items: center;

        img {
          width: 8px;
          height: 8px;
          margin-right: 4px;
        }
      }

      .opt-wrap {
        position: absolute;
        top: $padding-top-header + 3px;
        right: 10px;

        img {
          width: 20px;
          height: 20px;
          margin-left: 15px;
        }

        .opt-wrap-setting {
          font-size: 32px;
        }
      }

      .opt-export-wrap {
        display: none;
      }
    }

    .chat-info-bg {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      //background: red;
      background: linear-gradient(180deg, $color-bg-start 0%, $color-bg-end 100%);
      z-index: -1;
    }

    .chat-footer-audio {
      padding: 38px 20px 4px;
      min-height: 80px;
      position: absolute;
      left: 0;
      right: 0;
      bottom: $height-footer;
      background-color: $color-bg-footer-start;
      display: none;
      &.chat-footer-audio-open {
        display: block;
      }
      .audio-message {
        font-size: 14px;
        line-height: 24px;
        word-break: break-all;
      }
      .audio-btn {
        position: absolute;
        top: 8px;
        width: 30px;
        height: 30px;
        color:#fff;
        &.audio-btn-close {
          left: 20px;
        }
        &.audio-btn-send {
          right: 20px;
        }
      }
      .audio-timer {
        position: absolute;
        top: 8px;
        left: 58px;
        font-size: 12px;
        line-height: 30px;
        color: #fff;
      }
    }

    .chat-info {
      background-color: transparent;
      flex-grow: 1;
      padding: $height-header 20px $height-footer + 10px;

      .chat-info-item {
        @include mixin.clearfix;

        img {
          display: block;
          margin-left: auto;
          margin-right: 0;
          width: 32px;
          height: 32px;
          border: 1px solid #3DB3E6;
          border-radius: 16px;
        }

        span {
          word-break: break-all;
          font-size: 14px;
          color: #FFFFFF;
          letter-spacing: 0;
          line-height: 24px;
          min-width: 60px;
          position: relative;
          text-align: justify;
          // white-space: pre-wrap; /* 保留换行符，允许文本在单词之间换行 */
          float: right;
          display: inline-block;
          margin: 10px 0 10px 0;
          background: variables.$color-btn-bg;
          border-radius: 8px;
          padding: 10px 8px;

          &::before {
            position: absolute;
            top: -8px;
            right: 35px;
            content: '';
            display: inline-block;
            width: 18px;
            height: 9px;
            background-image: url('@/assets/bubble-arrow-2.png');
            background-size: cover;
            background-repeat: no-repeat;
          }
        }

        &.chat-info-item-assistant {
          text-align: right;

          img {
            margin-left: 0;
            margin-right: auto;
          }

          span {
            color: #333333;
            float: left;
            background: #B8CBD9;

            &::before {
              top: -8px;
              left: 35px;
              background-image: url('@/assets/bubble-arrow-1.png');
            }
          }
        }
      }
    }

    .chat-info-question-suggest {
      //bottom: $height-footer + 12px;
      //left:  20px;
      //right: 20px;
      font-size: 14px;
      line-height: 24px;
      display: flex;
      flex-direction: column;

      .suggest-item {
        margin-top: 6px;
        padding: 6px 12px;
        border-radius: 8px;
        background-color: variables.$color-btn-bg;
        color: #fff;
        word-break: break-all;
        cursor: pointer;
        font-weight: 300;

        //&:hover {
        //  background-color: lighten(variables.$color-btn-bg, 10%);
        //}
      }
    }

    .chat-footer {
      z-index: 10;
      position: fixed;
      bottom: 0;
      width: 100vw;
      height: $height-footer;
      padding: 0 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: linear-gradient(180deg, $color-bg-footer-start 0%, $color-bg-end 100%);

      .footer-text-area {
        flex-grow: 1;
        margin: 0 10px;
        background: #FFFFFF;
        height: 50px;
        line-height: 50px;
        font-size: 16px;
        color: variables.$color-text-normal;
        padding: 0 25px;
        border-radius: 25px;
        border: none;

        input {
          line-height: 50px;
        }
      }

      img.icon-chat {
        width: 32px;
        height: 32px;
      }

      img.icon-send {
        width: 36px;
        height: 36px;
      }
    }
  }

  #latest-report-content {
    font-size: 14px;
    line-height: 24px;

    h2 {
      line-height: 38px;
      margin-bottom: 16px;
    }

    h3 {
      margin-top: 16px;
      font-size: 16px;
      font-weight: 600;
      line-height: 38px;
    }

    strong {
      display: inline-block;
    }

    p > strong {
      margin-top: 12px;
    }

    li > strong {
      margin-top: 8px;
    }
  }

  /* 加载动画样式 */
  .loading-spinner {
    display: inline-block;
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    border-left-color: #09f;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
}